home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet Info 1994 March
/
Internet Info CD-ROM (Walnut Creek) (March 1994).iso
/
answers
/
comp
/
x-faq
/
part5
< prev
next >
Wrap
Text File
|
1994-03-04
|
44KB
|
886 lines
Newsgroups: comp.windows.x,news.answers,comp.answers
Path: bloom-beacon.mit.edu!hookup!swrinde!cs.utexas.edu!uunet!visual!dbl
From: dbl@visual.com (David B. Lewis)
Subject: comp.windows.x Frequently Asked Questions (FAQ) 5/6
Message-ID: <CM59JI.A75@visual.com>
Followup-To: poster
Summary: useful information about the X Window System
Reply-To: faq%craft@uunet.uu.net (X FAQ maintenance address)
Organization: VISUAL, Inc.
Date: Fri, 4 Mar 1994 14:28:30 GMT
Approved: news-answers-request@MIT.Edu
Expires: Sun, 3 Apr 1994 00:00:00 GMT
Lines: 870
Xref: bloom-beacon.mit.edu comp.windows.x:22117 news.answers:16018 comp.answers:4035
Archive-name: x-faq/part5
Last-modified: 1994/03/03
----------------------------------------------------------------------
Subject: 94) Where can I find X tools callable from shell scripts?
I want to have a shell script pop up menus and yes/no dialog boxes if the user
is running X.
Several tools in the R3 contrib/ area were developed to satisfy these
needs: yorn pops up a yes/no box, xmessage displays a string, etc. There are
several versions of these tools; few, if any, have made it to the R4 contrib/
area, though they may still be available on various archive sites.
XScript, a collection of X shell scripts, is on csc.canberra.edu.au
under /pub/motif/xscript and also on ftp.x.org; it includes several stand-alone
X applications which can be embedded in shell scripts. XScript requires
tclMotif 1.0 or later.
In addition, Richard Hesketh (rlh2@ukc.ac.uk) has posted the xmenu
package to comp.sources.x ("v08i008: xmenu") for 1-of-n choices. [7/90]
Two versions of XPrompt have been posted to comp.sources.x, the latter
being an unauthorized rewrite. [R. Forsman (thoth@reef.cis.ufl.edu), 1/91]
There is a version of XMenu available from comp.sources.x; it is
being worked on and will likely be re-released.
xp-1.1.tar.Z, xpick-1.0.tar.Z and xzap-1.0.tar.Z on ftp.x.org's
contrib/ are tools by Gerry.Tomlinson@newcastle.ac.UK which act as X versions
of the simple display and choice-making tools in K&P. [4/92]
xtpanel lets the user build a panel containing interactive objects such
as buttons, sliders, text fields, etc., either from the command line or using a
simple scripting language. It is available for anonymous ftp from
hanauma.Stanford.EDU (36.51.0.16) as pub/X/xtpanel-3.01.tar.Z and may also be
found in the alt.sources archives.
----------------------------------------------------------------------
Subject: 95) Where can I get an X-based debugger?
xdbx, an X interface to the dbx debugger, is available via ftp from
ftp.x.org. The current [1/91] version is 2.1 patchlevel 2.
An X interface to gdb called xxgdb is more like xdbx 2.1.2. It is part
of comp.sources.x volume 11 [2/91]; xxgdb-1.06.tar.Z is on ftp.x.org.
mxgdb is a Motif interface to gdb by Jim Tsillas
(jtsillas@proteon.com); version 1.2 was released 11/93.
UPS is a source-level debugger which runs under the X11 (and SunView)
window systems on Sun, DEC, and Linux platforms. It is available from ftp.x.org
(18.24.0.11) as contrib/ups-2.45.tar.Z (also ups-2.45-to-2.45.2.patch.Z)
and unix.hensa.ac.uk (129.12.21.7) in /pub/misc/unix/ups (or try mail to
archive@unix.hensa.ac.uk). [10/92] Unofficial fixes by Rod Armstrong
(rod@sj.ate.slb.com) are on unix.hensa.ac.uk in
/misc/unix/ups/contrib/rod@sj.ate.slb.com.
Also:
MIPS produces a highly-customizable (WCL-based) Visual Debugger.
You should be able to use Sun's dbxtool with its X11/NeWS server.
The CodeCenter (617-498-3000) source-level debugger, available on most
major platforms, includes an X-based interface.
AT&T offers the eXamine Graphical Interface, an X11 interface to dbx
and C++ dbx for Sun3 and Sun4 and sdb and sdb++ for 386 and 3B2 platforms. Call
1-508-960-1997 or contact examine@mvuxi.att.com for more information.
Solbourne (+1 303-678-4626) offers PDB, its X-based debugger for C, C++
and Fortran. PDB uses the OI toolkit and runs in either Open Look or Motif
mode.
SCO (info@sco.com) offers dbXtra as part of several development
systems.
Lucid's Energize Programming System, a tightly integrated development
environment for C and C++ programs, incorporates a graphical user interface on
top of an extended version of gdb. Info: lucid-info@lucid.com, or
(800) 223-9322.
----------------------------------------------------------------------
Subject: 96) How can I "tee" an X program identically to several displays?
There are several protocol multiplexer tools which provide for the
simultaneous display of X clients on any number of machines.
XMX (an X Protocol Multiplexor) is available from wilma.cs.brown.edu
(128.148.33.66) as pub/xmx.tar.Z It works independently of the server and does
not affect the application being shared; it was developed for use in the
electronic classroom. An update is expected soon [5/93].
XTV is a conference program which can be used to duplicate the
"chalkboard" on several displays. Release 1 is available on the X11R5 contrib
tapes; a more recent version is on ftp.cs.odu.edu as pub/wahab/XTV.r2.tar.Z.
SHX from Michael Altenhofen of Digital Equipment GmbH CEC Karlsruhe
also does this; it is a "WYSIWIS" (What You See Is What I See) package in the
context of a computer-based learning/training tool to provide online help from
remote tutors but is also useful for general window sharing. Information:
shX@nestvx.enet.dec.com. SHX can be found on ftp.x.org and
gatekeeper.dec.com:/pub/X11/contrib/shX.tar.Z,
crl.dec.com:/pub/X11/contrib/shX.tar.Z
Modifications to SHX for color mapping and private color allocation by
Mark J. Handley (M.Handley@cs.ucl.ac.uk) are on cs.ucl.ac.uk in
car/shX.car.tar.Z.
XTrap is implemented as a server/library extension and can be used
to record and then replay an x session. It is available as
ftp.x.org:/contrib/XTrapV33_X11R5.tar.Z.
wscrawl can be used as a "multi-person paint program". It's available
on sax.stanford.edu as wscrawl.shar.Z. Binaries are on doppler.ncsc.org in
pub/wscrawl.
Shdr implements a simple shared whiteboard, without a chalk-passing
mechanism. It's available on parcftp.xerox.com as pub/europarc/shdr.tar.Z.
SketchPad 1.0 (3/93) is a distributed interactive graphical editor
particularly designed for sketching. Sources have been posted to alt.sources
and are available from ftp.igd.fhg.de (192.44.32.1) in ~ftp/incoming/sketchpad.
The NESTOR project is described in "Upgrading A Window System For
Tutoring Functions", Michael Altenhofen et al., the proceedings of the EXUG
Conference 11/90.
Also of use:
Hewlett-Packard Co. has a commercial product, "HP SharedX" which works
under HP-UX currently on their 300, 400, and 700 series workstations and their
HP 700/RX X Stations. Machines receiving shared windows can be any X server.
HP SharedX consists of a server extensions and a Motif based user interface
process. Contact your local HP sales rep. for more information.
IBM offers a commercial product.
Sun offers multi-user confering software called ShowMe.
InSoft (Mechanicsburg, PA, USA, 717-730-9501) offers multi-user
conferencing software called Communique. Version 3.0 is available on Sun and
HP platforms.
Vartalaap is a multiparty multimedia Conferencing System that works
over Unix sockets; the interfaceis based on XView. It's available at
ftp.x.org under contrib/vartalaap.tar.Z.
Collage is a synchronous collaborative data analysis tool for use
over the Internet. Features include a shared whiteboard, screen
capture/sharing, a shared text editor, and data-analysis tools. Sources are
on ftp.ncsa.uiuc.edu (141.142.20.50) in /UNIX/XCollage/Collage1.2. Version
1.2 became available 10/93.
[Thanks in part to scott@spectra.com (Tim Scott), 5/91, and to Peter Cigehn
(peter@lulea.trab.se), 8/92 ]
----------------------------------------------------------------------
Subject: 97) Can I use C++ with X11? Motif? XView?
The X11R4/5 header files are compatible with C++. The Motif 1.1 header
files are usable as is inside extern "C" {...}. However, the definition of
String in Intrinsic.h can conflict with the libg++ or other String class and
needs to be worked around.
Some other projects which can help:
WWL, a set of C++ classes by Jean-Daniel Fekete to wrap X Toolkit
widgets, available via anonymous FTP from ftp.x.org as contrib/WWL-1.2.tar.Z
[7/92] or lri.lri.fr (129.175.15.1) as pub/WWL-1.2.tar.Z. It works by
building a set of C++ classes in parallel to the class tree of the widgets.
The C++ InterViews toolkit is obtainable via anonymous FTP from
interviews.stanford.edu. InterViews uses a box/glue model similar to that of
TeX for constructing user interfaces and supports multiple looks on the user
interfaces. Some of its sample applications include a WYSIWIG document editor
(doc), a MacDraw-like drawing program (idraw) and an interface builder
(ibuild).
THINGS, a class library written at the Rome Air Force Base by the
Strategic Air Command, available as freeware on archive sites.
Motif++ is a public-domain library that defines C++ class wrappers
for Motif 1.1 and 1.2; it adds an "application" class for, e.g., initializing
X, and also integrates WCL and the Xbae widget set. This work was developed
by Ronald van Loon <rvloon@motif.hacktic.nl> based on X++, a set of bindings
done by the University of Lowell Graphics Research Laboratory. The current
sources are available from decuac.dec.com (192.5.214.1) in
/pub/X11/motif++.28.jul.93.tar.gz; in the UK check src.doc.ic.ac.uk. Send to
motif++-request@motif.hacktic.nl to be added to the mailing list.
Xm++ is a user interface framework for C++ using the Motif and Athena
toolkits. Source is on ftp.x.org as contrib/Xm++.0.52.tar.Z; or email to
xmplus@ani.univie.ac.at.
The source code examples for Doug Young's "Object-Oriented Programming
with C++ and OSF/Motif" [ISBN 0-13-630252-1] do not include "widget wrappers"
but do include a set of classes that encapsulates higher-level facilities
commonly needed by Motif- or other Xt-based applications; check ftp.x.org in
~ftp/contrib/young.c++.tar.Z.
Rogue Wave offers "View.h++" for C++ programmers using Motif; info:
1-800-487-3217 or +1 503 754 2311.
A product called "Commonview" by Glockenspiel Ltd, Ireland (??)
apparently is a C++-based toolkit for multiple window systems, including PM,
Windows, and X/Motif.
Xv++ is sold by Qualix (415-572-0200; fax -1300); it implements an
interface from the GIL files that Sun's OpenWindows Developers Guide 3.0
produces to Xview wrapper classes in C++.
UIT is a set of C++ classes embedding the XView toolkit; it is intended
for use with Sun's OpenWindows Developers Guide 3.0 builder tool. Sources are
on ftp.x.org as UIT.tar.Z. Version 2 was released 5/28/92.
Also of likely use is ObjectCenter (Saber-C++). And a reasonable
alternative to all of the above is ParcPlace's (formerly Solbourne's) Object
Interface.
[Thanks to Douglas S. Rand (dsrand@mitre.org) and George Wu (gwu@tcs.com);2/91]
----------------------------------------------------------------------
Subject: 98) Where can I obtain alternate language bindings to X/Xt/Motif?
Versions of the CLX Lisp bindings are part of the X11 core source
distributions. A version of CLX is on the R5 tape [10/91]; version 5.0.2 [9/92]
is on ftp.x.org in /contrib/CLX.R5.02.tar.Z.
The SAIC Ada-X11 bindings are through anonymous ftp in /pub from
stars.rosslyn.unisys.com (128.126.164.2) [perhaps
falcon.stars.ballston.paramax.com (129.204.6.253)?]
There is an X/Ada study team sponsored by NASA JSC, which apparently is
working out bindings. Information: xada@ghg.hou.tx.us.
GNU SmallTalk has a beta native SmallTalk binding to X called STIX (by
Steven.Byrne@Eng.Sun.COM). It is still in its beginning stages, and
documentation is sparse outside the SmallTalk code itself. The sources are
available as /pub/gnu/smalltalk-1.1.1.tar.Z on prep.ai.mit.edu (18.71.0.38) or
ugle.unit.no (129.241.1.97).
Prolog bindings (called "XWIP") written by Ted Kim at UCLA while
supported in part by DARPA are available by anonymous FTP from
ftp.x.org:contrib/xwip.tar.Z or ftp.cs.ucla.edu:pub/xwip.tar.Z.
These prolog language bindings depend on having a Quintus-type foreign function
interface in your prolog. The developer has gotten it to work with Quintus and
SICStus prolog. Inquiries should go to xwip@cs.ucla.edu. [3/90]
Scheme bindings to Xlib, OSF/Motif, and Xaw are part of the Elk
distribution; version 1.5a on ftp.x.org obsoletes the version on the R5 contrib
tape.
TCL bindings to Motif 1.[12] by Jan Newmarch
(jan@pandonia.canberra.edu.au) are on csc.canberra.edu.au and ftp.x.org.
Version 0.8 became available 11/93.
x-scm, a bolt-on accessory for Aubrey Jaffer's "scm" Scheme interpreter
that provides an interface to Xlib, Motif, and OpenLook, is now available via
FTP from altdorf.ai.mit.edu:archive/scm/xscm1.05.tar.Z and
nexus.yorku.ca:pub/scheme/new/xscm1.05.tar.Z.
Poplog V14.2 is offered by Integral Solutions Ltd. (Phone +44 (0)256
882028; Fax +44 (0)256 882182; Email isl@integ.uucp); it is an integrated
programming environment consisting of the programming languages Pop-11,
Prolog, Standard ML, and Lisp which are compiled to machine code via a common
virtual machine. Pop-11 provides an interface to the X Toolkit which can be
accessed from all other Poplog languages. The OLIT, Motif, and Athena widget
sets are supported, in addition to the custom Poplog (Xpw) widget set.
High-level Pop-11 libraries allow graph drawing, turtle graphics, and the
simple creation of basic button/menu based interfaces.
Ada bindings to Motif, explicitly, will eventually be made available by
the Jet Propulsion Laboratories, probably through the normal electronic
means. Advance information can be obtained from dsouleles@dsfvax.jpl.nasa.gov,
who may respond as time permits.
AdaMotif is a complete binding to X and Motif for the Ada language, for
many common systems; it is based in part upon the SAIC/Unisys bindings and also
includes a UIL to Ada translator. Info: Systems Engineering Research
Corporation, 1-800-Ada-SERC (well!serc@apple.com).
Also: the MIT Consortium, although not involved in producing Ada
bindings for X, maintains a partial listing of people involved in X and Ada;
information is available from Donna Converse, converse@x.org.
----------------------------------------------------------------------
Subject: 99) TOPIC: BUILDING THE X DISTRIBUTION [topic needs updating to R5]
----------------------------------------------------------------------
Subject: 100) What's a good source of information on configuring the X build?
This FAQ includes information on a number of "gotchas" that can bite
you on particular system. However, the best source of general information on
building the X11 release is found in the Release Notes. The file is bundled
separately from the rest of the release, so if it's become separated from your
sources you can FTP another copy separately: the file RELNOTES.[ms,PS,TXT] at
the top of the distribution. The file RELNOTES is also available from the
xstuff mail server.
In addition, O'Reilly & Associates's Volume 8 on X Administration
includes information on configuring and building X.
----------------------------------------------------------------------
Subject: 101) Why doesn't my Sun with a cg6 work with R5?
Apparently gcc is the problem; it seems to produce fine code for all
Sun displays except for the cgsix. The new sunGX.o distributed with fix-07
may fix the problem (note: not known to work on Solaris).
----------------------------------------------------------------------
Subject: 102) Why doesn't my Sun with SunOS 4.1 know about _dlsym, etc.?
If you get errors with _dlsym _dlopen _dlclose undefined, link with
libdl.a. Add "-ldl" to your and eventually to your site.def. You may want to
surround it with "-Bstatic -ldl -Bdynamic" if you add it to the EXTRA_LIBRARIES
variable, since "syslibs" get added after EXTRA_LIBRARIES on the eventual
compilation command; otherwise you may not have a shared libdl. (Or compile
the stubs shared.)
[thanks to Joe Backo (joe.backo@East.Sun.COM), 12/91]
----------------------------------------------------------------------
Subject: 103) What is this "_get_wmShellWidgetClass undefined" error?
In SunOS 4.1.2 Sun fixed a shared-library bug in ld which conflicts
with the way X builds the shared Xmu library, causing these symbols, notably,
to be undefined when building some X11 clients on SunOS 4.1.[23]:
_get_wmShellWidgetClass
_get_applicationShellWidgetClass
Compiling "-Bstatic -lXmu -Bdynamic" is overkill; be sure to set
OSTeenyVersion correctly in the config/sun.cf file and rebuild X11R5.
To solve the problem if you are using OpenWindows 3.0 (X11R4-based Xt), please
contact your local Sun office and request the following patches:
Patch i.d. Description
100512-02 4.1.x OpenWindows 3.0 libXt Jumbo patch
100573-03 4.1.x OpenWindows 3.0 undefined symbols when using
shared libXmu
[Greg Earle, earle@Sun.COM; 7/92]
A source patch for use with the X11R4 libraries was developed by Conrad
Kimball (cek@sdc.boeing.com); it retrofits into R4 some fixes made in R5 to
get around this problem. The patch is on ftp.x.org in [1/93]
contrib/X11R4_sunos4.1.2_patch_version3.Z
----------------------------------------------------------------------
Subject: 104) What's this problem with undefined _X symbols on SunOS 4.1.3?
Make sure to set the OSTeenyVersion in the mit/config/sun.cf file
if you see that vast numbers of Xlib functions are undefined:
>cc -o bmtoa bmtoa.o -O -pipe -L../.././lib/Xmu -lXmu -L/work1/X11R5/lib
>ld: Undefined symbol
> _XGetVisualInfo
> _XFree
...
----------------------------------------------------------------------
Subject: 105) Why does cc get used when I build X11R5 with gcc?
When X11R5 was written gcc (version 1.X) did not support shared
libraries. Those parts requiring shared libraries are compiled with cc, those
that don't are compiled with gcc.
----------------------------------------------------------------------
Subject: 106) Why can't gcc 1.x compile X11R4 on my SPARC?
I used gcc to compile the whole distribution, but I get several segmentation
faults when running X.
Note first that gcc on RISC machines does not necessarily result in
any performance increase; it certainly is not as noticeable as it is on the
680x0 or VAX platforms.
Here is the problem: gcc and cc use incompatible methods of passing
structures as arguments and returning them as function values, so when
gcc-compiled parts of X are linked with Sun-supplied functions that pass or
return structs, run-time errors occur. Affected programs include rgb and
the server.
This is from the GCC manual:
On the Sparc, GNU CC uses an incompatible calling convention for
structures. It passes them by including their contents in the argument
list, whereas the standard compiler passes them effectively by
reference.
This really ought to be fixed, but such calling conventions are not yet
supported in GNU CC, so it isn't straightforward to fix it.
The convention for structure returning is also incompatible, and
`-fpcc-struct-return' does not help.
You can duck the problem either by using cc throughout or by using it for just
the routines which cause incompatibilities; the problem cannot be solved with
compilation flags.
Files which need to be compiled using cc include:
server/os/4.2bsd/oscolor.c
rgb/rgb.c
In addition, several of the "inet_" functions use structs as args or
return values:
clients/xhost/xhost.c
clients/xauth/gethost.c.
Calls to inet_addr in /lib/CLX/socket.c and lib/X/XConnDis.c are possibly
harmless as they don't involve structs.
[collected by bashford@scripps.edu (Don Bashford); 8/90]
----------------------------------------------------------------------
Subject: 107) What are these I/O errors running X built with gcc?
When I try to run xinit or the Xsun server I get the error
"Getting interface configuration: Operation not supported on socket.
Fatal server bug! no screens found."
Running the gcc fixincludes script apparently didn't work. You can do
this simple test:
#include <sys/ioctl.h>
SIOCGIFCONF
Run that through cc -E and gcc -E. The last line of output is the piece of
interest; it should be identical (modulo irrelevant differences like
whitespace). If the gcc version has 'x' where the cc version has 'i', your
fixincludes run didn't work for some reason or other; go back to your gcc
sources and run `fixincludes`; then rebuild the X distribution. If they are
identical, try running a make clean in mit/server and rebuilding, just to make
sure everything gets compiled with the proper include files.
[courtesy der Mouse, mouse@LARRY.MCRCIM.MCGILL.EDU; 9/90]
----------------------------------------------------------------------
Subject: 108) What are these problems compiling X11R4 on the older Sun3?
In mit/server/ddx/sun/sunCG3C.c, we have found "missing" defines for
CG3AC_MONOLEN, CG3BC_MONOLEN, CG3AC_ENBLEN, CG3BC_ENBLEN. What should these be?
The R4 Errata list distributed after X11R4 mentions that you can add
these lines to the file on older SunOS versions (e.g. 3.5) to compile:
#define CG3AC_MONOLEN (128*1024)
#define CG3AC_ENBLEN CG3AC_MONOLEN
#define CG3BC_MONOLEN CG3AC_MONOLEN
#define CG3BC_ENBLEN CG3AC_MONOLEN
However, the Sun3 should not actually ever have the CG3 device, and so
references to it can be removed from mit/server/ddx/sun/sunInit.c and the
Imakefile. [11/90]
----------------------------------------------------------------------
Subject: 109) What are these problems compiling the X server on SunOS 4.1.1?
The file <sundev/cg6reg.h> isn't being found.
Sun omitted <sundev/cg6reg.h> from SunOS 4.1.1. Remove the #include
from sunCG6C.c and replace it with the line
#define CG6_VADDR_COLOR 0x70016000
The file has changed from earlier versions of SunOS and should not be copied
from another distribution.
----------------------------------------------------------------------
Subject: 110) What are these problems using R4 shared libraries on SunOS 4?
All of the executables that I try to run have the following results:
ld.so: libXmu.so.4: not found
or even:
ld.so: call to undefined procedure __GetHostname from 0xf776a96c
If you are building with shared libraries on a Sun, remember that you
need to run "ldconfig" as root after installing the shared libraries (if you've
installed X on a file-server, run it on the server's clients, too). While
building and installing the distribution, you need to be careful to avoid
linking against any existing X shared libraries you might have (e.g. those
distributed with OpenWindows). You should make sure you do not have
LD_LIBRARY_PATH set in your environment during the build or the installation.
If you are going to keep xterm and xload as setuid programs, please note that
the shared libraries must be installed in /usr/lib, /usr/local/lib, or
/usr/5lib for these programs to work (or else those programs must be linked
statically). [courtesy X Consortium]
Note also that the program mkfontdir is run as part of the build; it
attempts, however, to use the shared libraries before they have been installed.
You can avoid the errors by building mkfontdir statically (pass -Bstatic to
most C compilers).
----------------------------------------------------------------------
Subject: 111) Can OLIT programs run with R5 Xt? (_XtQString undefined)
This is a bug in the OLIT. _XtQString was an external symbol that existed in
X11R4 (upon which OW 3.0's libXt is based). It wasn't documented and was
removed in X11R5 (MIT's guarantee of upward compatibility between the R4 and R5
libraries only applied to the documented interface).
A workaround is to temporarily set your LD_LIBRARY_PATH to point to the X11R4
or OpenWindows Xt library that you linked the program against.
[10/92; from Barry Margolin (barmar@think.com); 3/93 from Jeff Francis
(jpf@heliocentric.com)]
----------------------------------------------------------------------
Subject: 112) How do I get around the SunOS 4.1 security hole?
There is a security problem with certain R4 clients (xterm and xload)
running under SunOS 4.1 that have been installed setuid root and are using
shared libraries; to avoid the problem, do one of these:
1) make the program non-setuid. You should consult your system
administrator concerning protection of resources (e.g. ptys and /dev/kmem) used
by these programs, to make sure that you do not create additional security
problems at your site.
2) relink the programs statically (using -Bstatic).
3) install the libraries before linking and link with absolute paths
to the libraries.
[from rws@x.org (Bob Scheifler), 12/90]
The R5 version of xterm does this automatically by rebuilding xterm against the
newly-installed libraries when xterm is being installed; this prevents an suid
program from being built with libraries specified relatively. Note that this
may cause an inconvenience when doing the installation from NFS-mounted disks.
Xload has been rewritten to avoid the problem.
----------------------------------------------------------------------
Subject: 113) How do I get around the frame-buffer security hole?
On many systems the frame-buffer is unsecured by default; this permits
anyone who can log into your workstation to peek at your windowing session by
accessing the frame-buffer directly, or, as less of a privacy issue but perhaps
more annoying, to [accidentally] start up a second X session on your console
display. Check the man page for fbtab(5).
[Thanks to Art Mulder (art@cs.ualberta.ca); 2/93.]
----------------------------------------------------------------------
Subject: 114) TOPIC: BUILDING X PROGRAMS
----------------------------------------------------------------------
Subject: 115) What is Imake?
Imake is not a replacement for the make program; instead, it is a
makefile-generator that takes advantages of the include-file and macro-
processing capabilities of the C preprocessor cpp to generate makefiles
suitable for building software on a particular system. Although it is not
specific to X, the X release uses it to help solve a number of the
configuration issues that arise in making such a large system widely portable.
Imake has a fairly steep learning curve, in part because the process by
which the system-specific configuration files, system-independent configuration
files, and individual Imakefiles are melded to produce a Makefile is not
obvious.
There have been several different versions of imake; the R3, R4, and
R5 versions are different.
You can obtain information on imake from these sources:
- the R4 and R5 release notes and imake man page include information on
using Imake to build X
- the R4 and R5 file mit/config/README also contains useful information
- on the R4 tapes, contrib/doc/imake/imake.tex is Mark Moraes' R3/R4
guide to imake.
- the R5 mit/doc/config/usenixws/paper.ms contains a paper by Jim
Fulton on an early version of Imake
- Paul DuBois (dubois@primate.wisc.edu) has written a useful
explanation of how Imake works and how to use it in configuring X for non-
supported systems; the document is available from ftp.primate.wisc.edu
in the directory ~ftp/pub/imake-stuff; look for config-X11R4.ms (troff) and
config-X11R4.ps (PostScript). Some supplemental appendices are nearby.
[7/91: document version is now 1.06] These imake papers are available by email;
mail a message body of "send imake-stuff help" to almanac@primate.wisc.edu.
They are also available by gopher to gopher.primate.wisc.edu under "Primate
Center Software Archives".
- see "System Administration - Imake: Friend or Foe?" by Dinah McNutt
in the November 1991 issue of SunExpert.
- German readers should expect in June 1992 an article "Das Meta-Make
/ I make, you make / Schwerelos" by Rainer Klute in "iX
Multiuser-Multitasking-Magazin", directed at application programmers needing to
write Imakefiles. An English-language derivative of this article is in The
X Journal, issue 2:1.
- The O'Reilly X Resource issue #2 contains Paul Davey's article on
demystifying Imake.
- Alain Brossard's working document full of tips on Imake is in
sasun1.epfl.ch:pub/imakefile.1.Z.
- O'Reilly has published (7/93) "Software Portability with imake" by
Paul DuBois; ISBN 1-56592-055-4. The books electronic counterparts are on
ftp.primate.wisc.edu in pub/imake-book; imake.tar.Z is a stand-alone imake
installation.
[1/91;12/91;5/92;8/92;7/93]
----------------------------------------------------------------------
Subject: 116) Where can I get imake?
Versions are distributed with the R4 and R5 releases. An earlier
version is distributed with the X11R3 release; some third-party toolkits
redistribute versions of imake along with their own implementations of the
template and configuration files. There are no real standards for such
configuration files, although most *current* contributed software expects the
templates distributed with X11R5.
ftp.x.org contains the R5 distribution unpacked, so you can pick up
imake without picking up the entire distribution.
A stand-alone version of Imake, but one stemming from X11R5, is in
ftp.germany.eu.net:pub/X11/misc/imake/imake-pure.tar.Z (192.76.144.75).
A stand-alone version of Imake, but one stemming from X11R5, is in
ftp.primate.wisc.edu:pub/imake-book/imake.tar.Z.
----------------------------------------------------------------------
Subject: 117) I have a program with an Imakefile but no Makefile. What to do?
If you have R4 or R5 installed on your system, run "xmkmf". This is a
script which runs imake for you with the correct arguments. The output is a
Makefile configured for your system and based on the Imakefile. Then run make,
which will use that new Makefile to compile the program.
----------------------------------------------------------------------
Subject: 118) Why can't I link to the Xlib shape routines?
When I try to compile certain programs, I get the following link error:
Undefined:
_XShapeQueryExtension
_XShapeCombineMask
These routines are actually part of the Shape Extension to X (SHAPE)
which was introduced in the X11R4 distribution and allows non-rectangular
windows. Like the other sample server extensions, the shape extension will
only run on a server which supports it. Pre-X11R4 servers, as well as many
vendor-supplied servers, do not support the shape extension, in which case
they will display rectangular windows anyway.
In order to use the shape extension, you must link to the library
libXext.a. In the X11R4 distribution, this library and the associated includes
will be in the mit/extensions directory. If you do not have these files, do
not despair: many freeware programs which use the shape extension can also be
compiled without it by removing the -DSHAPE define from the Makefile; you can
probably do this and compile successfully against your older vendor-supplied X
libraries.
[from John B. Melby, melby%yk.fujitsu.co.jp@uunet.uu.net, 3/91]
----------------------------------------------------------------------
Subject: 119) What are these problems with "_XtInherit not found" on the Sun?
When I link a X program that I wrote on a SunOS 4.0.3 or 4.1 machine I get the
error "ld.so: symbol not found _XtInherit".
What you are seeing is a side-effect of a kludge in the R4 libXt.a to
get Sun shared libraries working. Apparently, you can't share a function that
is both called and compared, as _XtInherit is. This was handled by putting
_XtInherit in the same file as a function that is always used, thereby
guaranteeing that it would be loaded -- that is, in Initialize.c, where
XtToolkitInitialize() and XtInitialize() reside. These routines would normally
be called.
You are probably seeing this error because your program is not a normal
Xt-based program and does not call XtToolkitInitialize() anywhere.
1) it may be a program that uses Xt functions but never opens a
connection to the X server. [OSF/Motif's 1.1.0 UIL had this problem; it called
XtMalloc() and other Xt functions.] The solution is to add the call to your
program; the function does not have to be executed, just linked in.
2) alternatively, your program doesn't need any Xt functions and is
correct in not calling XtToolkitInitialize() -- it may be an Xlib or XView
program. In this case, you can remove -lXt from your link command.
It should not be necessary to link the shared libraries statically,
although this will certainly solve the problem.
[from Jordan Hayes (now jordan@MooreNet.COM) and Danny Backx (db@sunbim.be);
11/90]
You may also see this error compiling X11R5 programs on a SunOS 4.1.3 machine;
be sure to set OSTeenyVersion to 3 in the config/sun.cf file.
----------------------------------------------------------------------
Subject: 120) TOPIC: PROGRAMMING PROBLEMS AND PUZZLES
----------------------------------------------------------------------
Subject: 121) Why doesn't my program get the keystrokes I select for (sic)?
The window manager controls how the input focus is transferred from one
window to another. In order to get keystrokes, your program must ask the
window manager for the input focus. To do this, you must set up what are
called "hints" for the window manager. If your applications is Xlib-based, you
can use something like the following:
XWMHints wmhints;
...
wmhints.flags = InputHint;
wmhints.input = True;
XSetWMHints(dpy, window, &wmhints)
If your application is based on the Xt Intrinsics, you can set the XtNinput
resource to be True (as you probably want to in any case); if you don't have
source, you can start up the application with the resource '*input:True'.
Certain window managers, notably dxwm and olwm, are very picky about having
this done.
If you are using Sun's OpenWindows olwm, you can also add this resource
to your defaults file to use clients that aren't ICCCM-compliant.
OpenWindows.FocusLenience: true
[mostly courtesy Dave Lemke of NCD and Stuart Marks of Sun]
----------------------------------------------------------------------
Subject: 122) How do I deiconify a window?
To de-iconify a window, map it with XMapWindow(). To iconify a window, use
XIconifyWindow().
----------------------------------------------------------------------
Subject: 123) How do I figure out what window manager is running?
You can't reliably tell; whatever mechanism you could use could be
spoofed in any case.
For most cases, you shouldn't care which window manager is running, so
long as you do things in an ICCCM-conformant manner. There are some cases in
which particular window managers are known to do things wrong; checking for
particular hints placed on the window by the window manager so that you can
sidestep the problem may be appropriate in these cases. Alternatively, it may
be appropriate to determine which window manager is running in order to take
advantage of specific *added* features (such as olwm's push-pin menus) in order
to give your program *added* functionality. Beware of usurping the window
manager's functions by providing that functionality even when it is missing;
this surely leads to future compatibility problems.
----------------------------------------------------------------------
Subject: 124) Is there a skeleton X program available?
There is no general framework such as the TransSkel program for the
Macintosh which handles lots of the odds and ends and overhead of development
under a window system and which can be used as a platform for additional
development. In X, the problem is typically solved by using an interactive
application builder tool or by using cut&paste on existing X applications. Good
applications which you might look to manipulate when you want to "test just
this one little thing" include contrib/clients/xskel, a simple R4 program that
puts up a window and allows sketching in it and offers a starting point for
quick hacks, the Xaw examples in the examples/ directory in the R3 and R4
distributions, and the Xlib "Hello World" example in the R3 doc/HelloWorld and
R4 doc/tutorials/HelloWorld; an updated version of this program which uses R4
Xlib calls and current ICCCM conventions was posted in 2/90 to comp.windows.x
by Glenn Widener of Tektronix. [3/90]
In addition, a sample Xt program (for Xaw or Xm) by Rainer Klute
showing how to open multiple displays and how to catch a broken display
connection is available on ftp.x.org in contrib/mdisp.tar.Z. [4/92]
A sample multi-display Xt/Xaw program by Oliver Jones is on ftp.x.org
in contrib/MultiUserVote.tar.Z. (See also his article in The X Resource, Issue
3, "Multi-User Application Software Using Xt".)
----------------------------------------------------------------------
Subject: 125) Why does XtGetValues not work for me (sic)?
The XtGetValues interface for retrieving resources from a widget is
sensitive to the type of variable. Your code may be doing something like this:
{
Arg args[3];
int i;
int sensitive; /* oops; wrong data type */
i=0;
XtSetArg (args[i], XtNsensitive, &sensitive); i++;
XtGetValues(widget, args, i );
...
}
But XtNsensitive is a Boolean, which on most machines is a single byte;
declaring the variable "sensitive" as Boolean works properly. This problem
comes up often when using particular toolkits that redefine the Xt types
Dimension and Position; code that assumes they are int will have similar
problems if those types are actually short. In general: you are safe if you
use the actual type of the resource, as it appears in the widget's man page.
[11/90]
----------------------------------------------------------------------
Subject: 126) Why don't XtConfigureWidget/XtResizeWidget/XtMoveWidget work?
You're probably trying to use these functions from application code.
They should be used only internally to widgets; these functions are for a
parent Composite widget to change the geometry of its children. An
application which calls XtMoveWidget, for example, effectively defeats
geometry negotiation and the Composite parent's internal state (if any) will
no longer be correct. (The Xt specification goes into more detail.)
The only way for your application to request a geometry change for a
widget is to issue an XtSetValues call setting some of the geometry
resources. Although this call will result in the widget-internal functions'
being called, your application code must use the standard XtSetValues
interface or risk the widgets' data becoming corrupted.
Note that functions defined in <X11/IntrinsicP.h>, as these are, are
typically reserved for use by widgets.
Other promising functions, XtMakeGeometryRequest() and
XtMakeResizeRequest(), are also for use only by widgets, in this case by a
child to request a change from its parent.
The Xlib calls XMoveWindow() and XResizeWindow() should similarly be
avoided; they shouldn't be used to change XtNx, XtNy, XtNwidth, or XtNheight.
----------------------------------------------------------------------
Subject: 127) Why isn't there an XtReparentWidget call like XReparentWindow?
Although there are various details of the current implementation of
the Xt internals which make reparenting difficult, the major reason that no
such call exists is that it remains undefined what the set of resources for
the "new" widget should be. Resources are typically set based on the location
in the instance hierarchy; what resources should change if the instance moves?
What should happen to the widget's children? And by the time such semantics are
defined, there would probably be little advantage over destroying the old
widget and creating a new widget in the correct location with the desired
resources, as setting the resources correctly is the majority of work in
creating a new widget.
Note that reparenting is possible in the OI toolkit.
----------------------------------------------------------------------
Subject: 128) I'm writing a widget and can't use a float as a resource value.
Float resources are not portable; the size of the value may be larger than
the size of an XtPointer. Try using a pointer to a float instead; the Xaw
Scrollbar float resources are handled in this way.
----------------------------------------------------------------------
Subject: 129) Is this a memory leak in the X11R4 XtDestroyWidget()?!
Yes. This is the "unofficial" fix-19 for the X11R4 Destroy.c:
*** Destroy.c.1.37 Thu Jul 11 15:41:25 1991
--- lib/Xt/Destroy.c Thu Jul 11 15:42:23 1991
***************
*** 1,4 ****
--- 1,5 ----
/* $XConsortium: Destroy.c,v 1.37 90/09/28 10:21:32 swick Exp $ */
+ /* Plus unofficial patches in revisions 1.40 and 1.41 */
/***********************************************************
Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
***************
*** 221,239 ****
*/
int i = 0;
! DestroyRec* dr = app->destroy_list;
while (i < app->destroy_count) {
if (dr->dispatch_level >= dispatch_level) {
Widget w = dr->widget;
if (--app->destroy_count)
bcopy( (char*)(dr+1), (char*)dr,
! app->destroy_count*sizeof(DestroyRec)
);
XtPhase2Destroy(w);
}
else {
i++;
- dr++;
}
}
}
--- 222,245 ----
*/
int i = 0;
! DestroyRec* dr;
while (i < app->destroy_count) {
+
+ /* XtPhase2Destroy can result in calls to XtDestroyWidget,
+ * and these could cause app->destroy_list to be reallocated.
+ */
+
+ dr = app->destroy_list + i;
if (dr->dispatch_level >= dispatch_level) {
Widget w = dr->widget;
if (--app->destroy_count)
bcopy( (char*)(dr+1), (char*)dr,
! (app->destroy_count - i) * sizeof(DestroyRec)
);
XtPhase2Destroy(w);
}
else {
i++;
}
}
}
[from Donna Converse, converse@x.org]
----------------------------------------------------------------------
Subject: 130) Is this a memory leak in the X11R4 deletion of work procs?!
Apparently the X11R4 NextEvent.c`CallWorkProc fails to properly replace
the work proc record back on the free list correctly.
if (delete) {
w->next = freeWorkRecs;
freeWorkRecs = w->next; /* should be =w; */
}
----------------------------------------------------------------------
Subject: 131) Why does the process size of my X programs go up,up,up?
Using "ps" may not show any decrease in memory size after a malloc/free pair.
With most vendors' implementations of memory managers, the call to free does
not return memory to the operating system; it is probably maintained on a free
list for the process. In addition, ps may not be an accurate report of current
memory usage requirements.
----------------------------------------------------------------------
Subject: 132) Are callbacks guaranteed to be called in the order registered?
Although some books demonstrate that the current implementation of Xt
happens to call callback procedures in the order in which they are registered,
the specification does not guarantee such a sequence, and supplemental
authoritative documents (i.e. the Asente/Swick volume) do say that the order is
undefined. Because the callback list can be manipulated by both the widget and
the application, Xt cannot guarantee the order of execution.
In general, the callback procedures should be thought of as operating
independently of one another and should not depend on side-effects of other
callbacks operating; if a seqence is needed, then the single callback to be
registered can explicitly call other functions necessary.
[4/92; thanks to converse@x.org]
----------------------------------------------------------------------
David B. Lewis faq%craft@uunet.uu.net
"Just the FAQs, ma'am." -- Joe Friday
--
David B. Lewis Temporarily at but not speaking for Visual, Inc.
day: dbl@visual.com evening: david%craft@uunet.uu.net